import * as echarts from 'echarts'
export default (config) => {
  return {
    grid: {
      left: '5%',
      right: '15%',
      top: '15%',
      bottom: '0%',
      containLabel: true
    },
    xAxis: {
      name: 'time/s',
      nameTextStyle: {
        color: '#ccc',
        fontStyle: 'normal',
        fontWeight: 'bold',
        fontFamily: 'sans-serif'
      },
      type: 'time',
      axisLabel: {
        rotate: 35
      }
    },
    yAxis: {
      name: '温度/℃',
      nameTextStyle: {
        color: '#ccc',
        fontStyle: 'normal',
        fontWeight: 'bold',
        fontFamily: 'sans-serif'
      },
      type: 'value',
      boundaryGap: [0, '100%'],
      max: config.max,
      min: config.min,
      splitLine: {
        show: false
      },
      axisLine: {
        show: true
      }
    },
    series: [
      {
        name: '温度',
        type: 'line',
        smooth: true,
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: 'rgba(22, 242, 217, 0.5)'
            },
            {
              offset: 1,
              color: 'rgba(22, 242, 217, 0)'
            }
          ])
        }
      }
    ],
    tooltip: {
      trigger: 'axis'
    }
  }
}
